{function name=tree}
	<ul>
		{foreach $rootItems as $rootItem}
			<li title="{$rootItem->Page->title}" rev="{$rootItem->Page->id}">
				<a href="{$rootItem->Page->url}">{$rootItem->Page->title}</a>
				{if count($rootItem->Items)}
					{tree rootItems=$rootItem->Items}
				{/if}
			</li>
		{/foreach}
	</ul>
{/function}
<input type="hidden" id="menu_id" name="menu[id]" value="{$menu->id}" />
<div class="row">
	<label for="menu_title">Заголовок</label>
	<input type="text" id="menu_title" name="menu[title]" value="{$menu->title}" />
</div>
<div id="edit_menu_right" class="jstree-drop">
	<div id="edit_menu_right_">
		{if count($menu->avaliablePages())}
			<ul>
				{foreach from=$menu->avaliablePages() item=page}
					<li title="{$page->title}" rel="default" rev="{$page->id}"><a href="/" >{$page->title}</a></li>
				{/foreach}
			</ul>
		{/if}
	</div>
	<div id="edit_menu_cart" class="jstree-drop">
		<div id="edit_menu_cart_">
			{if count($in_cart)}
				<ul>
					{foreach from=$in_cart item=page}
						<li title="{$page->title}" rel="default" rev="{$page->id}"><a href="/" >{$page->title}</a></li>
					{/foreach}
				</ul>
			{/if}
		</div>
	</div>
</div>
<div id="edit_menu_left" class="jstree-drop">
	{tree rootItems=$menu->rootItems}
</div>
<div class="clear"></div>
<div class="buttons">
	<input type="button" id="save_menu" value="Применить" class="apply"/>
</div>